<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        .box {
            width: 200px;
            height: 200px;
        }
    </style>
</head>
<body>

    <div class="box">
        hah
    </div>

    <nav id="head-nav"></nav>

    <div>
        2ha
    </div>
    
    <script>
        // 通过CSS选择器进行选择
        const box = document.querySelector(".box")

        

        console.log(box)

        const nav = document.querySelector("#head-nav")
        console.log(nav)

        const alldiv = document.querySelectorAll("div")
        console.log(alldiv)
        
    </script>
</body>
</html>